Micron Document
Fox's Git Mirrors

Node / rns-mirrors / Reticulum-Go.git / files / pkg / backbone / test_helpers_test.go

Displaying Raw • Download

pkg/backbone/test_helpers_test.go 61af5556362c8bdf7c09a1c01bc84f81629f281b (61af5556) Text, 716 B

// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2024-2026 Quad4.io

package backbone

import (
"runtime"
"testing"
)

func testHubWithBackend(t *testing.T, backend Backend) *Hub {
t.Helper()
Shutdown()
hub, err := Init(backend)
if err != nil {
t.Fatalf("Init(%s): %v", backend, err)
}
t.Cleanup(Shutdown)
return hub
}

func testableBackends(t *testing.T) []Backend {
t.Helper()
backends := []Backend{BackendGo}
switch runtime.GOOS {
case "linux", "android":
backends = append(backends, BackendEpoll)
if UringProbeAllowed() {
backends = append(backends, BackendUring)
}
case "darwin", "freebsd", "netbsd", "openbsd":
backends = append(backends, BackendKqueue)
}
return backends
}

Served by rngit 1.5.2 - Generated in 0.03s